﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using TaskManager.Data;

using Microsoft.Practices.Unity;
using Microsoft.Practices.Unity.Configuration;

namespace TaskManager
{
    public partial class Sprint
    {
        public IList<Task> GetTasks()
        {
            IList<Task> tasks = null;

            using (IUnityContainer container = new UnityContainer())
            {
                container.LoadConfiguration();
                ISprintRepository sprintRepository = container.Resolve<ISprintRepository>();
                tasks = sprintRepository.GetTasks(this);
            }
            return tasks;
        }

        public void Copy(Sprint src)
        {
            this.StartDate = src.StartDate;
            this.EndDate = src.EndDate;
        }
    }
}